package VN.EDU.IMIC.DEVELOPER.TRANTHITHANHNGA.ARRAY.EX09;

public class Models {

	/**
	 * Compute weekly hours per employee
	 * 
	 * @param int[][] workingHour
	 * @return int[] totalHour
	 */

	public int[] computeTotalHour(int[][] workingHour) {
		int k =0;
		int[] totalHour = new int[workingHour.length];
		for (int i = 0; i < workingHour.length; i++) {
			int sum =0;
				for (int j = 0; j < workingHour[i].length; j++) {
					sum += workingHour[i][j];
					totalHour[k]=sum;
			} k++;		
	}
			for(int i=0; i< totalHour.length; i++){
				for(int j =i+1; j<= totalHour.length -1; j++){
					if(totalHour[i]<totalHour[j]){
						int temp = totalHour[i];
						totalHour[i]=totalHour[j];
						totalHour[j]=temp;
				}
			}
		}
		
		return totalHour;
}
}
